package com.four.hospital.controller;

import com.four.common.utils.R;
import com.four.hospital.entity.Appointment;
import com.four.hospital.service.AppointmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:wsy
 * @Date: 2022/01/17/19:02
 * @Description
 */
@RestController
@RequestMapping("hospital/appointment")
public class AppointmentController {

    @Autowired
    private AppointmentService appointmentService;

    /**
     * 预约
     * @param userPhone
     * @param docId
     * @return
     */
    @PostMapping("/toAppointment/{userPhone}/{docId}")
    public R toAppointment(@PathVariable("userPhone")String userPhone,
                           @PathVariable("docId")Integer docId){
        return appointmentService.toAppointment(userPhone,docId);
    }
}
